/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Client.gui;

import java.awt.Color;
import java.awt.Graphics2D;

/**
 *
 * @author Ripper
 */
public class TextEffect extends Effect
{
    private String text;
    private int x; 
    private int y;
    private Color c;
    
    public TextEffect(int ttl, String txt, int xl, int yl, Color col)
    {
        super(ttl);
        
        text = txt;
        x = xl;
        y = yl;
        c = col;
    }

    @Override
    public void draw(Graphics2D g) 
    {
        g.setColor(c);
        
        int length = text.length() * 3;
        
        g.drawString(text, x - ((length / 2)*3), y - (getLifespanPrct() / 2));
    }

    public Color getC() {
        return c;
    }

    public void setC(Color c) {
        this.c = c;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
    
    
}
